package com.itheima.多态;

public abstract class Animal {
    //String name = "狗狗";
    public abstract void eat();
}


class  Cat extends Animal{


    @Override
    public void eat() {
        System.out.println("猫吃鱼");
    }
}


class Dog extends Animal{
    String name = "狗狗";

    @Override
    public void eat() {
        System.out.println("狗吃肉");
    }


    public void lookHome(){
        System.out.println("狗狗会看家");
    }
}
class Pig extends Animal{

    @Override
    public void eat() {
        System.out.println("猪吃白菜");
    }
}